#include "stm32f10x.h"
#include "MySPI.h"

void W25Q64_Init(void){
    MySPI_Init();
}
void W25Q64_ReadID(uint8_t *MID,uint8_t *DID){
  MySPI_Start();
  MySPI_SwapByte(0x9F);
  *MID=MySPI_SwapByte(0xFF);
  *DID=MySPI_SwapByte(0xFF);
  *DID<<8;
  *DID|=MySPI_SwapByte(0xFF);
  MySPI_Stop();
}
// void W25Q64_ReadID(uint8_t *MID, uint16_t *DID) {
//     MySPI_Start();
//     MySPI_SwapByte(0x9F);  // 发送JEDEC ID命令
//     *MID = MySPI_SwapByte(0xFF);  // 读取制造商ID
//     *DID = MySPI_SwapByte(0xFF) << 8;  // 读取并左移高字节
//     *DID |= MySPI_SwapByte(0xFF);  // 读取低字节并组合
//     MySPI_Stop();
// }